home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / menu-new.tar / menu-new / menu / menu.h < prev    next >
C/C++ Source or Header  |  1993-04-08  |  2KB  |  90 lines

  1. /*    PSC MENU COPYRIGHT NOTICE
  2.  
  3.     Part of PSCMenu
  4.  
  5.     This software is to be considered to be public domain, it
  6. may be copied, modified and parts of it may be used in other programs
  7. as long as this copyright notice remains intact.
  8.  
  9.     Copyright()   PSC - Plymouth State College
  10.     Written by:   Ted Wisniewski 12-9-1990
  11.  
  12. */
  13. #include <curses.h>
  14. #include <unistd.h>
  15.  
  16. # define     FOURK        4096
  17. # define     ONEK        1024
  18. # define    BUF_SIZ        256
  19. # define    LINESZ        90
  20. # define     FIRST_LINE    0
  21. # define    STATUS_LINE    22
  22. # define    NUMCOL        22
  23. # define    DESCOL        25
  24. # define     LAST_LINE    23
  25. # define     CONT_LINE    21
  26. # define     N_ENTRIES    9
  27. # define     RE_DRAW        ('r' & 037)
  28. # define     MAIN_MENU    "main.menu"
  29. # define    MENU_DIR    "/usr/local/lib/menus/"
  30. # define    RETURN        0x0d
  31. # define    LF        0x0a
  32. # define    SPACE        0x20
  33.  
  34. # ifndef TRUE
  35. # define    TRUE        1
  36. # define    FALSE        0
  37. #endif TRUE
  38.  
  39. # define     CENTER        40
  40. # define     HEADER        "LINUX Menu System"
  41. # define    CMD_LIN        "h)elp q)uit"
  42. # define    CONTINUE    1
  43. # define    NO_CONTINUE    0
  44.  
  45. # define     Sprintf        (void) sprintf
  46. # define    Strcpy        (void) strcpy
  47. # define    Strcat        (void) strcat
  48. # define    Fprintf        (void) fprintf
  49. # define    Fflush        (void) fflush
  50. # define    Fputc        (void) fputc
  51. # define    Fputs        (void) fputs
  52. # define    Fgets        (void) fgets
  53. # define    Pclose        (void) pclose
  54.  
  55. # ifndef HPUX
  56. # define    Getwd        (void) getwd
  57. # else
  58. # define    Getwd        (void) getcwd
  59. # endif HPUX
  60.  
  61. # define    Wait        (void) wait
  62. # define    Execl        (void) execl
  63.  
  64. int catch();
  65.  
  66. char *strcat(), *strcpy();
  67.  
  68. typedef struct
  69. {
  70.     char key;        /* Key character for command types.  */
  71.     char desc[LINESZ];    /* Description of command.         */
  72.     char **script;        /* Strings to make a shell script.   */
  73.     char cmd[LINESZ];      /* The Command.                      */
  74.         char help_fil[LINESZ];  /* Name of the Help file for option. */
  75.         char execdir[LINESZ];   /* Name of the dir to cd to before exec. */
  76.     int  AllowWander;    /* Let change dir in visual */
  77. }menu_ent;
  78.  
  79. menu_ent main_menu[N_ENTRIES];
  80.  
  81. typedef int FLAG;
  82.  
  83. FLAG m_flag;
  84.  
  85.  
  86. char line[BUF_SIZ], buffer[BUF_SIZ], string[BUF_SIZ];
  87. char menu_dir[BUF_SIZ];
  88.  
  89. int get_term();
  90.